package ca.uwaterloo.titslongcall;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class CallCardActivity extends Activity{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_callcard);
		Button addthiscallcard = (Button) findViewById(R.id.addcallcard);
		final EditText prefix = (EditText) findViewById(R.id.prenum);
		final EditText pin = (EditText) findViewById(R.id.pinnum);
		addthiscallcard.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				String Pre = prefix.getText().toString();
				String PIN = pin.getText().toString();
				if (!(Pre.equals("")||PIN.equals(""))){
					Intent returnact = new Intent();
					returnact.putExtra("cardPre", Pre);
					returnact.putExtra("cardPin", PIN);
					setResult(RESULT_OK, returnact);
					finish();
				}
			}
		});
	}

}
